Imports System
Imports System.Collections
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Web
Imports System.Web.SessionState
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Imports Ajax
Imports BA.Chat

Partial Class ChatRoom
    Inherits WebPageBase

    Private engine As New ChatMain()

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Ajax.Utility.RegisterTypeForAjax(GetType(ChatEngine))
        Ajax.Utility.RegisterTypeForAjax(GetType(ChatEngineUser))

        Me.Page.Header.DataBind()

        If Session("UserName") Is Nothing Then
            Response.Write("<script language=""javascript"">" + "" & Chr(10) & "")
            Response.Write("alert(""Please Login First"")" + "" & Chr(10) & "</script>")
            Response.Write("<script language=javascript>window.location.href='ChatRoom.aspx';</script>")
        End If
    End Sub

    Protected Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit

        Try
            If Not Profile.UI.Theme = String.Empty Then
                If IsThemeValid(Profile.UI.Theme.ToString) Then
                    Page.Theme = Profile.UI.Theme
                Else
                    Page.Theme = WebBase.AppTheme
                End If
            Else
                Page.Theme = WebBase.AppTheme
            End If
        Catch ex As Exception
            Page.Theme = WebBase.AppTheme
        End Try

    End Sub

End Class
